<?php


namespace App\Http\Model\Common;


use App\Enum\EnumEnum;
use Illuminate\Support\Facades\DB;

class CityModel
{

    /**
     * 通用-获取当前用户有权限的城市:查询
     *
     * @param $where
     * @param $pfsId
     *
     * @return array
     */
    public static function search($where, $pfsId)
    {
        return DB::select("SELECT id,`key`,`val`,`desc` FROM `enum` WHERE `pfs_dw_id` IN ({$pfsId}) AND `classify`=:classify AND `is_del`=0 AND (`key` LIKE :key OR `val` LIKE :val) group by `val`", [
            'classify' => EnumEnum::CITY,
            'key'      => "%{$where}%",
            'val'      => "%{$where}%",
        ]);
    }

}





/**
 * CityModel.php
 *
 * 说明:
 *
 * 修改历史
 * ----------------------------------------
 * 2021/6/15 11:37:00   操作:创建
 **/
